package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.MerchantPayType;
import com.rockcent.mall.lib.domain.enumclass.MerchantRechargeStatus;
import com.rockcent.mall.lib.domain.enumclass.MerchantRechargeType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 商户充值记录
 * Created by zhangjh on 2017/3/27.
 */
@Entity
@Table(name = "merchant_recharge_flow")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class MerchantRechargeFlow extends IDEntityMall {
    /**
     * 流水号
     */
    @Column(columnDefinition = "varchar(100) comment '流水号'")
    private String seqNo;

    /**
     * 商户ID
     */
    @Column(columnDefinition = "bigint(20) comment '商户ID'")
    private Long merchantId;

    /**
     * 平台ID
     */
    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    /**
     * 金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '金额'")
    private BigDecimal rechargeAmount;

    /**
     * 户名
     */
    @Column(columnDefinition = "varchar(30)  comment '户名'")
    private String rechargeAccountName;

    /**
     * 汇款账号
     */
    @Column(columnDefinition = "varchar(30)  comment '汇款账号'")
    private String rechargeAccount;

    /**
     * 汇款时间
     */
    @Column(columnDefinition = "varchar(30)  comment '充值日期'")
    private String rechargeDate;

    /**
     * 充值凭证
     */
    @Column(columnDefinition = "varchar(300)  comment '充值凭证'")
    private String rechargeVoucher;


    /**
     * 银行支行名
     */
    @Column(columnDefinition = "varchar(250) comment '支行名'")
    private String bankBranchName;


    /**
     * 银行名称
     */
    @Column(columnDefinition = "varchar(100) comment '银行名称'")
    private String bankName;


    /**
     * 充值状态
     */
    @Column(columnDefinition = "varchar(30) comment '充值状态 ALL(\"全部\"), WAIT(\"待审核\"), AUDITED(\"已审核\"), SUCCESS(\"成功\"), FAIL(\"失败\")'")
    @Enumerated(EnumType.STRING)
    private MerchantRechargeStatus rechargeStatus;


    /**
     * 支付类型
     */
    @Column(columnDefinition = "varchar(30) comment '支付类型 ALL(\"全部\"), ONLINE(\"线上支付\"), OUTLINE(\"线下支付\"),BASE_SERVICE_PAYMENTS(\"基础服务费扣费\"), RECHARGE_MALL(\"平台支付\")'")
    @Enumerated(EnumType.STRING)
    private MerchantPayType payType;


    /**
     * 充值类型
     */
    @Column(columnDefinition = "varchar(30) comment '充值类型 ALL(\"全部\"),RECHARGE_PRESENTED(\"充值赠送\"), RECHARGE_COMMON(\"普通充值\")'")
    @Enumerated(EnumType.STRING)
    private MerchantRechargeType rechargeType;


    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(100)  comment '备注'")
    private String remark;


    /**
     * 审核时间
     */
    @Column(columnDefinition = "datetime comment '审核时间'")
    private Date dateAudited;


    /**
     * 操作人员id
     */
    @Column(columnDefinition = "bigint(20) comment '操作人员id'")
    private Long operatorId;


    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public BigDecimal getRechargeAmount() {
        return rechargeAmount;
    }

    public void setRechargeAmount(BigDecimal rechargeAmount) {
        this.rechargeAmount = rechargeAmount;
    }

    public String getRechargeAccountName() {
        return rechargeAccountName;
    }

    public void setRechargeAccountName(String rechargeAccountName) {
        this.rechargeAccountName = rechargeAccountName;
    }

    public String getRechargeAccount() {
        return rechargeAccount;
    }

    public void setRechargeAccount(String rechargeAccount) {
        this.rechargeAccount = rechargeAccount;
    }

    public String getRechargeDate() {
        return rechargeDate;
    }

    public void setRechargeDate(String rechargeDate) {
        this.rechargeDate = rechargeDate;
    }

    public String getRechargeVoucher() {
        return rechargeVoucher;
    }

    public void setRechargeVoucher(String rechargeVoucher) {
        this.rechargeVoucher = rechargeVoucher;
    }

    public String getBankBranchName() {
        return bankBranchName;
    }

    public void setBankBranchName(String bankBranchName) {
        this.bankBranchName = bankBranchName;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public MerchantRechargeStatus getRechargeStatus() {
        return rechargeStatus;
    }

    public void setRechargeStatus(MerchantRechargeStatus rechargeStatus) {
        this.rechargeStatus = rechargeStatus;
    }

    public MerchantPayType getPayType() {
        return payType;
    }

    public void setPayType(MerchantPayType payType) {
        this.payType = payType;
    }

    public MerchantRechargeType getRechargeType() {
        return rechargeType;
    }

    public void setRechargeType(MerchantRechargeType rechargeType) {
        this.rechargeType = rechargeType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getDateAudited() {
        return dateAudited;
    }

    public void setDateAudited(Date dateAudited) {
        this.dateAudited = dateAudited;
    }

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    @Override
    public String toString() {
        return "MerchantRechargeFlow{" +
                "id=" + id +
                ", dateCreated=" + dateCreated +
                ", seqNo='" + seqNo + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", merchantId=" + merchantId +
                ", mallId=" + mallId +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", rechargeAmount=" + rechargeAmount +
                ", rechargeAccountName='" + rechargeAccountName + '\'' +
                ", rechargeAccount='" + rechargeAccount + '\'' +
                ", rechargeDate='" + rechargeDate + '\'' +
                ", rechargeVoucher='" + rechargeVoucher + '\'' +
                ", bankBranchName='" + bankBranchName + '\'' +
                ", bankName='" + bankName + '\'' +
                ", rechargeStatus=" + rechargeStatus +
                ", payType=" + payType +
                ", rechargeType=" + rechargeType +
                ", remark='" + remark + '\'' +
                ", dateAudited=" + dateAudited +
                ", operatorId=" + operatorId +
                '}';
    }
}
